package file.test;

import java.io.File;

public class GetFile {
    public static void main(String[] args) {
        File file = new File(".");
        String names = getName(file);
    }
    public static String getName(File file){
        StringBuilder names = new StringBuilder("");
        if (file.isDirectory()){

        }else {
            names.append(file.getName());
        }
        return names.toString();
    }
}
